package com.list88zhu.android.sunflower.jetpack.room;

import android.arch.persistence.room.TypeConverter;

import java.util.Date;

/**
 * <pre><code>
 *
 *  </code></pre>
 *
 * @author zhuyingming@qmtv.com
 * @date 2018/8/26
 */
public class ConversionFactory {

    @TypeConverter
    public static Date longToDate(Long value) {
        return value == null ? null : new Date(value);
    }

    @TypeConverter
    public static Long dateToLong(Date date) {
        return date == null ? null : date.getTime();
    }
}
